<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
		<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
		<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<title>地址列表</title>
		<!-- 图标 -->
		<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css" />
		<!-- 控制头部和底部导航样式 -->
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<script>
			//若用户未登录，则需先登录
			var logstatu = sessionStorage['LoginName'];
			console.log("name is "+name);
			console.log("statu is "+logstatu);
			if (!logstatu) {
				location.href = 'c_login.html';
				console.log(logstatu);
			}
		</script>
		<script>$.mobile.ajaxEnabled = false;</script>
		<script src="js/login/register.js"></script>
		<script>
		if(true){
			//获取用户对象
		}else{
			//登录
		}
			var user = getUser();
		</script>
	</head>
	<body>

		<div data-role="page">
			<div data-role="header" data-position="fixed" id="opcitybg">
				<a id="headop" href="c_personal.html" data-role="button" data-icon="user" data-iconpos="notext"></a>
				<h1>我的地址</h1>
				<a id="headop" href="c_locationAdd.html" data-role="button" data-icon="plus" data-iconpos="notext"></a>
			</div>
			​
			<div data-role="main" class="ui-content">
				<ul data-role="listview" data-inset="true">
					<script type="text/javascript">
					var icon = 'locadefault';
					for(let i=0;i<user.addr.length;i++){
						if(i!=0){
							icon='location';//默认地址图标不同
						}
						document.write(
							'<li><a href="c_locationDetial.html?id='+i+'"><img src="./img/'+icon+'.jpg" alt="default"'+
										'class="ui-li-icon">'+user.addr[i].province+
									'<p>'+user.addr[i].detial+'</p>'+
								'</a></li>'
						);
					}
						
					</script>
				
					<li class ="defa"><a href="c_locationDetial.html"><img src="./img/locadefault.jpg" alt="default"
								class="ui-li-icon">江西省
							<p>南昌市青山湖区江西财经大学麦庐校区</p>
						</a></li>
					<li class ="defa"><a href="c_locationDetial.html"><img src="./img/location.jpg" alt="home" class="ui-li-icon">四川省
							<p>南昌市青山湖区江西财经大学麦庐校区</p>
						</a></li>
					<li class ="defa"><a href="c_locationDetial.html"><img src="./img/location.jpg" alt="school" class="ui-li-icon">新疆
							<p>南昌市青山湖区江西财经大学麦庐校区</p>
						</a></li>
					<li class ="defa"><a href="c_locationDetial.html"><img src="./img/location.jpg" alt="company"
								class="ui-li-icon">北京市
							<p>南昌市青山湖区江西财经大学麦庐校区</p>
						</a></li>
					<li class ="defa"><a href="c_locationDetial.html"><img src="./img/location.jpg" alt="other" class="ui-li-icon">武汉市
							<p>南昌市青山湖区江西财经大学麦庐校区</p>
						</a></li>
				</ul>

			</div>



			<div data-role="footer" data-position="fixed" id="footerbg">

				<div data-role="navbar">
					<ul>
						<ul>
							<li><a href="index.html" id="selectmenu"  data-ajax="false"><i
										class="fa fa-home fa-2x"></i><br><span>首页</span></a></li>
							<li><a href="c_activity.html" id="menua" data-ajax="false"><i class="fa fa-street-view fa-2x"></i><br><span>动态</span></a>
							</li>
							<li><a href="s_shopping_cart.html" id="menua" data-ajax="false"><i
										class="fa fa-shopping-cart fa-2x"></i><br>收藏</a></li>
							<li><a href="c_message.html" id="menua" data-ajax="false"><i class="fa fa-comments-o fa-2x"></i><br><span>信息</span></a></li>
							<li><a href="c_SellerManue.html" id="menua" data-ajax="false"><i
										class="fa fa-user-circle fa-2x"></i><br><span>卖家</span></a></li>
						</ul>
					</ul>
				</div>

			</div>
		</div>


	</body>
	<script>
		//登录之后取消默认显示
		if(user){
			$(".defa").css({
				display:"none",
			})
		}
	</script>
</html>
